package com.hfmall.service.impl;

import com.hfmall.entity.HfUser;
import com.hfmall.mapper.HfUserMapper;
import com.hfmall.service.IHfUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liclo
 * @since 2021-08-12
 */
@Service
public class HfUserServiceImpl extends ServiceImpl<HfUserMapper, HfUser> implements IHfUserService {
    @Resource
    private HfUserMapper userMapper;
    @Override
    public HfUser login(String account) {
        HfUser user=userMapper.getByName(account);
        return user;
    }

    @Override
    public void updateByID(HfUser hfUser) {
        userMapper.updateByID(hfUser);
    }



    @Override
    public HfUser findByCode(String code) {
        return userMapper.getByCode(code);
    }

    @Override
    public HfUser getbyName(String name) {
        return userMapper.getByName(name);
    }

    @Override
    public void updateMoney(Integer user_id, BigDecimal money) {
        userMapper.updateMoney(user_id,money);
    }
}
